package com.fs.iot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fs.common.base.service.AbstractBaseEntityService;
import com.fs.iot.bean.dto.AlarmDefinePublishedDTO;
import com.fs.iot.bean.query.AlarmDefinePublishedQuery;
import com.fs.iot.domain.entity.AlarmDefinePublishedEntity;
import com.fs.iot.domain.mapper.AlarmDefinePublishedMapper;
import com.fs.iot.service.AlarmDefinePublishedEntityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 报警定义服务实现 
 * @author Coder Generator 2025-03-25 09:08:32 
 **/
@Service
public class AlarmDefinePublishedEntityServiceImpl extends AbstractBaseEntityService<AlarmDefinePublishedEntity, AlarmDefinePublishedDTO, AlarmDefinePublishedMapper, AlarmDefinePublishedQuery> implements AlarmDefinePublishedEntityService {
    @Override
    protected QueryWrapper<AlarmDefinePublishedEntity> queryToWrapper(AlarmDefinePublishedQuery query) {
        return this.createQueryWrapper()
                .eq(StringUtils.isNotBlank(query.getId()), "id", query.getId())
                .in(null != query.getIds(), "id", query.getIds())
                .orderByDesc("create_time");
    }
}